<template>
    <div>
        <span :class="{active:topic.good || topic.top}">
            {{markText}}
        </span>
    </div>
</template>

<script>
export default {
    data() {
        return {
            
        }
    },
    props: {
        topic: Object,
    },
    computed: {
        markText() {
            return this.topic.top ? '置顶' : this.topic.good ? '精华':this.$store.state.tabs[this.topic.tab]
            }
    }
}
</script>

<style scoped lang="scss">
span {
    padding: 2px 6px;
    font-size: 12px;
    background: #e5e5e5;
    color: #999;
    border-radius: 5px;
}

span.active {
    background: #80bd01;
    color: #fff;
}
</style>